package com.aspose.cells.a.d.a;

import java.awt.Color;
import java.awt.Font;
import java.awt.font.TextAttribute;
import java.util.Hashtable;
import java.util.Map;
import java.util.Properties;

public class zl {
   private static final Properties a = new Properties();

   public static String a(String var0) {
      return a.getProperty(var0, var0);
   }

   public static Hashtable a(Font var0) {
      Hashtable var1 = new Hashtable(7, 0.9F);
      var1.put(TextAttribute.TRANSFORM, var0.getTransform());
      var1.put(TextAttribute.FAMILY, var0.getName());
      var1.put(TextAttribute.SIZE, new Float(var0.getSize2D()));
      var1.put(TextAttribute.WEIGHT, (var0.getStyle() & 1) != 0 ? TextAttribute.WEIGHT_BOLD : TextAttribute.WEIGHT_REGULAR);
      var1.put(TextAttribute.POSTURE, (var0.getStyle() & 2) != 0 ? TextAttribute.POSTURE_OBLIQUE : TextAttribute.POSTURE_REGULAR);
      var1.put(TextAttribute.SUPERSCRIPT, new Integer(0));
      var1.put(TextAttribute.WIDTH, new Float(1.0F));
      if (var0.getAttributes().containsKey(TextAttribute.UNDERLINE)) {
         var1.put(TextAttribute.UNDERLINE, var0.getAttributes().get(TextAttribute.UNDERLINE));
      }

      return var1;
   }

   public static void a(Map var0) {
      String var1 = (String)var0.get(TextAttribute.FAMILY);
      int var2;
      if (var1.toLowerCase().endsWith(".bold")) {
         var0.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);
         var2 = var1.toLowerCase().indexOf(".bold");
         var1 = var1.substring(0, var2);
      } else if (var1.toLowerCase().endsWith(".italic")) {
         var0.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);
         var2 = var1.toLowerCase().indexOf(".italic");
         var1 = var1.substring(0, var2);
      } else if (var1.toLowerCase().endsWith(".plain")) {
         var2 = var1.toLowerCase().indexOf(".plain");
         var1 = var1.substring(0, var2);
      }

      var1 = var1.substring(0, 1).toUpperCase() + var1.substring(1, var1.length());
      var0.put(TextAttribute.FAMILY, var1);
   }

   public static Color a(Color var0, Color var1) {
      int var2 = (var0.getRed() + var1.getRed()) / 2;
      int var3 = (var0.getGreen() + var1.getGreen()) / 2;
      int var4 = (var0.getBlue() + var1.getBlue()) / 2;
      return new Color(var2, var3, var4);
   }

   static {
      String var0 = "Arial";
      a.setProperty("Dialog", var0);
      a.setProperty("DialogInput", "Courier New");
      a.setProperty("Serif", "Times New Roman");
      a.setProperty("SansSerif", var0);
      a.setProperty("Monospaced", "Courier New");
      a.setProperty("Courier", "Courier New");
      a.setProperty("Helvetica", var0);
      a.setProperty("Times-Roman", "Times New Roman");
      a.setProperty("TimesRoman", "Times New Roman");
      a.setProperty("Times", "Times New Roman");
      a.setProperty("Symbol", "Arial Unicode MS");
      a.setProperty("ZapfDingbats", "Arial Unicode MS");
   }
}
